﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

/// <summary>
/// 设备
/// </summary>
[Index("ti_execute_time", Name = "idxexecute_time")]
[Index("ti_task_guid", Name = "idxlcuguid")]
[Index("ti_guid", Name = "idxlguid")]
[Index("ti_p_guid", Name = "idxpguid")]
[Index("ti_status", Name = "idxstatus")]
public partial class iot_device_task_time_interval
{
    [Key]
    public long ti_id { get; set; }

    [Required]
    [StringLength(50)]
    public string ti_guid { get; set; }

    /// <summary>
    /// 设备id
    /// </summary>
    [StringLength(50)]
    public string ti_task_guid { get; set; }

    /// <summary>
    /// 任务类型
    /// </summary>
    [StringLength(255)]
    public string ti_task_type { get; set; }

    /// <summary>
    /// 0正常，1无效
    /// </summary>
    public int ti_status { get; set; }

    /// <summary>
    /// 名称
    /// </summary>
    [StringLength(50)]
    public string ti_interval_name { get; set; }

    /// <summary>
    /// 数值
    /// </summary>
    public int? ti_interval_value { get; set; }

    /// <summary>
    /// 单位ss,mm,hh
    /// </summary>
    [StringLength(5)]
    public string ti_interval_unit { get; set; }

    /// <summary>
    /// 数值ss,0为不设置值
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? ti_start_time { get; set; }

    /// <summary>
    /// iot_device_command
    /// </summary>
    [StringLength(255)]
    public string ti_key { get; set; }

    /// <summary>
    /// iot_device_command
    /// </summary>
    [StringLength(255)]
    public string ti_value { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? ti_mod_time { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? ti_add_time { get; set; }

    /// <summary>
    /// 上次执行时间，默认值2000-01-01 00:00:00
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime ti_execute_time { get; set; }

    /// <summary>
    /// 客户
    /// </summary>
    [StringLength(100)]
    public string ti_c_guid { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    [StringLength(255)]
    public string ti_title { get; set; }

    /// <summary>
    /// 执行次数
    /// </summary>
    public int? ti_execute_count { get; set; }

    /// <summary>
    /// 0非模板，1模板
    /// </summary>
    public int? ti_is_template { get; set; }

    /// <summary>
    /// 产品iot_product
    /// </summary>
    [StringLength(50)]
    public string ti_p_guid { get; set; }

    /// <summary>
    /// 编号
    /// </summary>
    public int? ti_p_model_no { get; set; }

    /// <summary>
    /// 0启动，1不启动
    /// </summary>
    public int? ti_auto_run { get; set; }

    /// <summary>
    /// 0不参与自动配置，1参与自动配置
    /// </summary>
    public int? ti_auto_run_jion { get; set; }
}
